﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Game.Utilities
{
    [Serializable]
    public class DBAccountJackpot
    {
        public virtual void Dispose()
        {
        }

        public long AccountID { get; set; }
        public int JackpotWin { get; set; }
        public int RoomType { get; set; }
        public DateTime CreateDate { get; set; }

        public void Insert()
        {
            DBHelper db = new DBHelper(Config.Config.LogDBConnectionString);
            SqlCommand oCommand = new SqlCommand("sp_AccountJackpot_Insert");
            oCommand.CommandType = CommandType.StoredProcedure;
            oCommand.Parameters.Add(new SqlParameter("@AccountID", AccountID));
            oCommand.Parameters.Add(new SqlParameter("@JackpotWin", JackpotWin));
            oCommand.Parameters.Add(new SqlParameter("@RoomType", RoomType));

            db.ExecuteNonQuery(oCommand);
        }

        public List<DBAccountJackpot> GetListJackPot()
        {
            List<DBAccountJackpot> lst = new List<DBAccountJackpot>();

            DBHelper db = new DBHelper(Config.Config.LogDBConnectionString);
            SqlCommand oCommand = new SqlCommand("sp_AccountJackpot_GetList");
            oCommand.CommandType = CommandType.StoredProcedure;
            lst = db.GetList<DBAccountJackpot>(oCommand);
            return lst;
        }
    }
}
